

package com.hazelcast.internal.server;

import com.hazelcast.internal.nio.Connection;

/**
 * A ServerConnection is the serverside part of any form of connection on a member. So it could be member to member
 * connection, but it could also be the server side companion of a client to member connection.
 */
public interface ServerConnection extends Connection {

    /**
     * Gets the ServerConnectionManager this ServerConnection belongs to.
     *
     * @return the ServerConnectionManager.
     */
    ServerConnectionManager getConnectionManager();

    /**
     * Returns the connection type.
     * <p>
     * See  {@link com.hazelcast.internal.nio.ConnectionType} for in-house candidates. Note that a type could be
     * provided by a custom client, and it can be a string outside of {@link com.hazelcast.internal.nio.ConnectionType}
     *
     * @return the connection type. It could be that <code>null</code> is returned.
     */
    String getConnectionType();

    /**
     * Sets the type of the connection
     *
     * @param connectionType to be set
     */
    void setConnectionType(String connectionType);

    /**
     * Checks if it is a client connection.
     *
     * @return true if client connection, false otherwise.
     */
    boolean isClient();
}
